<?php
namespace Home\Controller;
use Think\Controller;
class RemindController extends Controller {
	/**
	 * 功能：显示404页面
	 * 时间和作者：2016-03-20  刘卫涛
	 * 参数：无
	 * 返回值：无
	 **/
    public function index(){
    	$id=I("get.id");
    	$type=I("get.type");
    	switch ($type) {
        case 'carry':
        $M=M('orders');
            break;
        case 'nocarry':
         $M=M('order');
            break;
        default:
            # code...
            break;
    }
    $orderinfo=$M->find($id);
        $this->assign('orderinfo',$orderinfo);
    	$this->display();
    }

    public function pro(){
        $id=I("get.id");
        $type=I("get.type");
        
        $orderinfo=M('order_p')->find($id);
        $this->assign('orderinfo',$orderinfo);
        $this->display();
    }


    public function agree(){
        $data['id']=I("post.id");
        $data['agree_status']=1;
        $res=M('order_p')->save($data);
       if ($res) {
         exit('1');
       }else{
        exit('-1');
       }
    }

    public function refuse(){
        $data['id']=I("post.id");
        $data['agree_status']=-1;
        $res=M('order_p')->save($data);
       if ($res) {
         exit('1');
       }else{
        exit('-1');
       }
    }


    public function success()
    {
        $this->display();
    }
    
}